#!/usr/bin/node
const pic = process.argv[2],
      http=require('http'),
      fs = require('fs');

let data = fs.readFileSync(pic);
let uri = data.toString('base64');
//log(`uri:${uri}\n`);
let html =` <html><head><title>data uri</title></head><body><img src="data:image/jpg;base64,${uri}"/></body></html>`;

http.createServer((req,res)=>{
  res.end(html);
}).listen(8080);
